<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    const arr = [
        [
            120.571389,
            31.297283
        ],
        [
            120.570317,
            31.294496
        ],
        [
            120.574007,
            31.295046
        ]
    ];

    function getPos(arr)
    {
        console.log("getPos: ", arr)
        const arr2 = arr.map(item => {
            return [item.lng, item.lat]
        })
        console.log("arr2:", arr2)
        let temp = []
        for (let i = 0; i < arr.length; i++) {
            temp.push(arr[i][0] + "," + arr[i][1] + ";")
        }
        console.log("转换坐标:", temp.flat())
    }

    getPos(arr)
</script>
</body>
</html>
